<div id="tags">
<div id="perpage" class="section"> 
<h3>Page Viewing Options</h3> 
	     <div id="slider_wrapper"><div id="fpg">Feeds per page: <%= session[:per_page]%></div>
		<div id="track1" style="width:200px; height:9px;">
			<div id="track1-left"></div><div id="handle1" style="width:19px; height:20px;"><img src="/images/slider-images-handle.png" alt="" style="float: left;" /></div>
		</div>
	    <div id="slider">
		<script type="text/javascript" language="javascript">
		// <![CDATA[
		
			// horizontal slider control
			new Control.Slider('handle1', 'track1', {range: $R(1,20),sliderValue: 10, values:  [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],
				onSlide: function(v) { $('fpg').innerHTML = 'Feeds per page: ' + v ;

				},
				onChange: function(v) { $('fpg').innerHTML = 'Feeds per page: ' + v;
				new Ajax.Updater('feeds', '/blogs/list_items?per_page='+v, {asynchronous:true, evalScripts:true, onLoading:function(request){Element.show('update_indicator')}, onComplete:function(request){Element.hide('update_indicator'); new Ajax.Updater('seltags', '/blogs/tag_cloud_display', {asynchronous:true, evalScripts:true})}}); return false;
				 }
			});

		// ]]>
		</script>
		</div></div><br/>
		<% cache do %>
		<div id="sorter">
		<%= form_remote_tag( :url=>{:action => "list_items"}, 
		                     :options=>{:method=>"get"},  
                             :loading=>"Element.show('update_indicator')",
                             :complete=>"Element.hide('update_indicator')",
                             :update=>"feeds") %>
		  <select name="sortby" onChange="this.form.onsubmit();">
            <option value="none">Sort by...</option>
            <option value="atoz">A to Z</option>
            <option value="ztoa">Z to A</option>
            <option value="recent">most recent posts first</option>
            <option value="oldest">oldest posts first</option>
          </select>
        </form>
		</div></div>
		<div class="search">
		<h3>Blog search</h3> 
		<%= form_tag("/", {:id=>"searchform", :onSubmit => "Element.show('update_indicator');" }) %>
		<input id="searchtext" name="searchtext" type="text" value="type to search" 
		onfocus="if (this.value == 'type to search') {this.value = '';}"/>
		</form>
		<%= observe_form(:searchform,
                 :frequency => 0.5,
                 :update => "feeds",
                 :loading => "Element.show('update_indicator')",
                 :complete => "Element.hide('update_indicator')",
                 :url => { :action => "list_items"}) %>
           
		</div>
		<div class="section">
		<h3>Page Filtering Options</h3> 
  <%= link_to "<strong>Clear All Filters</strong>", :action=>"list", :new_filter=>"true" %>
<%= form_remote_tag( :url=>{:action => "list_items"}, 
                     :options=>{:method=>"get"}, 
                     :loading=>"Element.show('update_indicator')",
                     :complete=>"Element.hide('update_indicator')", 
                     :update=>"feeds") %>	
<select class="authority" name="authority" onChange="this.form.onsubmit();">
<option value="none">Filter by Authority</option>
<option value="none">Show All</option>
<%= options_from_collection_for_select(@authorities, "id", "name", @authority? @authority.id : "none")%>
</select>
</form>		
	<div id="seltags">				
	<%= tag_cloud %>
		</div>
</div>	
</div>
<% end %>